<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>


<body class="layui-layout-body layuimini-all">
    <div class="layuimini-container">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">学生专家</li>
                <li>职业专家</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <fieldset class="table-search-fieldset">
                        <!-- <legend>搜索信息</legend> -->
                        <div style="margin: 10px 10px 10px 10px">
                            <form class="layui-form layui-form-pane" action="">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width:100px ;">专家名称</label>
                                        <div class="layui-input-inline" style="width:150px ;">
                                            <input type="text" name="s_expert_name" autocomplete="off"
                                                class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width:100px ;">专家序号</label>
                                        <div class="layui-input-inline" style="width:150px ;">
                                            <input type="text" name="s_expert_id" autocomplete="off"
                                                class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                            lay-filter="data-search-btn2"><i class="layui-icon"></i> 搜 索</button>
                                    </div>
                                    <div class="layui-inline">
                                        <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                            lay-filter="data-reset-btn2"><i class="iconfont icon-empty"></i> 复
                                            原</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </fieldset>
                    <div id="many2">

                    </div>
                </div>
                <div class="layui-tab-item">
                    <fieldset class="table-search-fieldset">
                        <!-- <legend>搜索信息</legend> -->
                        <div style="margin: 10px 10px 10px 10px">
                            <form class="layui-form layui-form-pane" action="">
                                <div class="layui-form-item">
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width:100px ;">专家名称</label>
                                        <div class="layui-input-inline" style="width:150px ;">
                                            <input type="text" name="p_expert_name" autocomplete="off"
                                                class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width:100px ;">专家序号</label>
                                        <div class="layui-input-inline" style="width:150px ;">
                                            <input type="text" name="p_expert_id" autocomplete="off"
                                                class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                            lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
                                    </div>
                                    <div class="layui-inline">
                                        <button type="submit" class="layui-btn layui-btn-primary" lay-submit
                                            lay-filter="data-reset-btn"><i class="iconfont icon-empty"></i> 复 原</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </fieldset>
                    <div id="many">

                    </div>
                </div>
            </div>
        </div>
        <!-- <div id="main" style="width: 600px;height:400px;">
    </div> -->
        <script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
        <script src="../js/echarts.js" ,type="text/javascript"></script>
        <script>
            layui.use(['form', 'jquery', 'table'], function () {
                var $ = layui.jquery,
                    form = layui.form,
                    layer = layui.layer,
                    table = layui.table;
                // var aname = localStorage.getItem('aname');
                $(function () {
                    $.get('/showExpert', {
                        status: 2,
                        searchParams: 1
                    }, function (re) {
                        if (re == '0') {
                            layer.msg("暂无专家！");
                        } else {
                            console.log(re);
                            var obj = re.data;
                            var len = re.count;
                        }
                        html = '';
                        for (var i = 0; i < len; i++) {
                            html = html +
                                '<div id="main' + i +
                                '" style="width: 400px;height:500px;display:  inline-block;margin-left: 5px;margin-top: 10px;"></div>'
                        }
                        console.log(html)
                        $('#many').html(html);
                        console.log("len" + len)
                        for (var i = 0; i < len; i++) {
                            var myChart = echarts.init(document.getElementById('main' +
                                i));
                            var option;
                            //var name = obj[i].p_expert_name;
                            var name = obj[i].p_expert_name;
                            option = {
                                color: ['#6e42e6'],
                                title: {
                                    text: name + '学术水平雷达图',
                                    left: 'center'
                                },
                                // legend: {
                                //     data: ['学术水平']
                                // },
                                radar: {
                                    // shape: 'circle',
                                    indicator: [{
                                            name: '工作单位',
                                            max: 100
                                        },
                                        {
                                            name: '从业时长',
                                            max: 100
                                        },
                                        {
                                            name: '学历',
                                            max: 100
                                        },
                                        {
                                            name: '专业领域',
                                            max: 100
                                        },
                                        {
                                            name: '年龄',
                                            max: 100
                                        },
                                        {
                                            name: '职称',
                                            max: 100
                                        }
                                    ],
                                    axisName: {
                                        color: '#fff',
                                        backgroundColor: '#666',
                                        borderRadius: 3,
                                        padding: [4, 5]
                                    }
                                },
                                series: [{
                                    name: 'Budget vs spending',
                                    type: 'radar',
                                    data: [{
                                        value: [
                                            ((obj[i].w_place *
                                                    100) /
                                                0.2).toFixed(
                                                2),
                                            ((obj[i].w_time *
                                                    100) /
                                                0.1).toFixed(
                                                2),
                                            ((obj[i].edu *
                                                100) / 0.1)
                                            .toFixed(
                                                2),
                                            ((obj[i].field *
                                                100) / 0.3)
                                            .toFixed(
                                                2),
                                            ((obj[i].age *
                                                100) / 0.1)
                                            .toFixed(
                                                2),
                                            ((obj[i].p_title *
                                                    100) /
                                                0.2).toFixed(2)
                                        ],
                                        name: '学术水平',
                                        symbol: 'circle',
                                        symbolSize: 9,
                                        lineStyle: {
                                            color: 'rgba(170, 145, 200, 0.9)',
                                            type: 'dashed'
                                        },

                                        areaStyle: {
                                            color: new echarts
                                                .graphic
                                                .RadialGradient(0.1,
                                                    0.6, 1,
                                                    [{
                                                            color: 'rgba(190, 145, 200, 0.1)',
                                                            offset: 0
                                                        },
                                                        {
                                                            color: 'rgba(190, 145, 200, 0.9)',
                                                            offset: 1
                                                        }
                                                    ])
                                        },
                                        label: {
                                            show: true,
                                            fontSize: 15,
                                            color: '#6e42e6',
                                            formatter: function (
                                                params) {
                                                return params
                                                    .value;
                                            }
                                        }
                                    }]
                                }]
                            };
                            option && myChart.setOption(option);
                            // a = a + 0.01;
                        }
                    })

                })
                $(function () {
                    $.get('/showExpert', {
                        status: 1,
                        searchParams: 1
                    }, function (re) {
                        if (re == '0') {
                            layer.msg("暂无专家！");
                        } else {
                            console.log(re);
                            var obj = re.data;
                            var len = re.count;
                        }
                        html = '';
                        console.log("len" + len)
                        for (var i = 0; i < len; i++) {
                            html = html +
                                '<div id="main2' + i +
                                '" style="width: 600px;height:500px;display:  inline-block;margin-left: 10px;margin-top: 10px;"></div>'
                        }
                        console.log(html)
                        $('#many2').html(html);
                        console.log("len" + len)
                        for (var i = 0; i < len; i++) {
                            var myChart = echarts.init(document.getElementById('main2' +
                                i));
                            var option;
                            //var name = obj[i].p_expert_name;
                            var name = obj[i].s_expert_name;
                            var option;
                            option = {
                                color: ['#6e42e6'],
                                title: {
                                    text: name + '学术水平雷达图',
                                    left: 'center'
                                },
                                // legend: {
                                //     data: ['学术水平']
                                // },
                                radar: {
                                    // shape: 'circle',
                                    indicator: [{
                                            name: '校内职务',
                                            max: 100
                                        },
                                        {
                                            name: '防疫志愿者时长',
                                            max: 100
                                        },
                                        {
                                            name: '上网课时长',
                                            max: 100
                                        }
                                    ],
                                    axisName: {
                                        color: '#fff',
                                        backgroundColor: '#666',
                                        borderRadius: 3,
                                        padding: [4, 5]
                                    }
                                },
                                series: [{
                                    name: 'Budget vs spending',
                                    type: 'radar',
                                    data: [{
                                        value: [
                                            ((obj[i].s_title * 100) /
                                                0.4).toFixed(
                                                2),
                                            ((obj[i].v_time * 100) /
                                                0.5).toFixed(
                                                2),
                                            ((obj[i].c_time * 100) /
                                                0.1).toFixed(
                                                2)
                                        ],
                                        name: '学术水平',
                                        symbol: 'circle',

                                        symbolSize: 9,
                                        lineStyle: {
                                            color: 'rgba(170, 145, 200, 0.9)',
                                            type: 'dashed'
                                        },

                                        areaStyle: {
                                            color: new echarts.graphic
                                                .RadialGradient(0.1, 0.6, 1,
                                                    [{
                                                            color: 'rgba(190, 145, 200, 0.1)',
                                                            offset: 0
                                                        },
                                                        {
                                                            color: 'rgba(190, 145, 200, 0.9)',
                                                            offset: 1
                                                        }
                                                    ])
                                        },
                                        label: {
                                            show: true,
                                            fontSize: 15,
                                            color: '#6e42e6',
                                            formatter: function (params) {
                                                return params.value;
                                            }
                                        }
                                    }]
                                }]
                            };
                            option && myChart.setOption(option);
                        }
                    })
                })
                form.on('submit(data-search-btn)', function (data) {
                    var result = data.field;
                    $(function () {
                        console.log("result:" + result);
                        $.get('/showExpert', {
                            status: 2,
                            searchParams: result
                        }, function (re) {
                            if (re == '0') {
                                layer.msg("暂无专家！");
                            } else {
                                console.log(re);
                                var obj = re.data;
                                var len = re.count;
                            }
                            html = '';
                            for (var i = 0; i < len; i++) {
                                html = html +
                                    '<div id="main' + i +
                                    '" style="width: 400px;height:500px;display:  inline-block;margin-left: 5px;margin-top: 10px;"></div>'
                            }
                            console.log(html)
                            $('#many').html(html);
                            console.log("len" + len)
                            for (var i = 0; i < len; i++) {

                                var myChart = echarts.init(document.getElementById(
                                    'main' +
                                    i));
                                var option;
                                var name = obj[i].p_expert_name;
                                option = {
                                    color: ['#6e42e6'],
                                    title: {
                                        text: name + '学术水平雷达图',
                                        left: 'center'
                                    },
                                    // legend: {
                                    //     data: ['学术水平']
                                    // },
                                    radar: {
                                        // shape: 'circle',
                                        indicator: [{
                                                name: '工作单位',
                                                max: 100
                                            },
                                            {
                                                name: '从业时长',
                                                max: 100
                                            },
                                            {
                                                name: '学历',
                                                max: 100
                                            },
                                            {
                                                name: '专业领域',
                                                max: 100
                                            },
                                            {
                                                name: '年龄',
                                                max: 100
                                            },
                                            {
                                                name: '职称',
                                                max: 100
                                            }
                                        ],
                                        axisName: {
                                            color: '#fff',
                                            backgroundColor: '#666',
                                            borderRadius: 3,
                                            padding: [4, 5]
                                        }
                                    },
                                    series: [{
                                        name: 'Budget vs spending',
                                        type: 'radar',
                                        data: [{
                                            value: [
                                                ((obj[i].w_place *
                                                        100) /
                                                    0.2)
                                                .toFixed(
                                                    2),
                                                ((obj[i].w_time *
                                                        100) /
                                                    0.1)
                                                .toFixed(
                                                    2),
                                                ((obj[i].edu *
                                                        100) /
                                                    0.1)
                                                .toFixed(
                                                    2),
                                                ((obj[i].field *
                                                        100) /
                                                    0.3)
                                                .toFixed(
                                                    2),
                                                ((obj[i].age *
                                                        100) /
                                                    0.1)
                                                .toFixed(
                                                    2),
                                                ((obj[i].p_title *
                                                        100) /
                                                    0.2)
                                                .toFixed(2)
                                            ],
                                            name: '学术水平',
                                            symbol: 'circle',
                                            symbolSize: 9,
                                            lineStyle: {
                                                color: 'rgba(170, 145, 200, 0.9)',
                                                type: 'dashed'
                                            },

                                            areaStyle: {
                                                color: new echarts
                                                    .graphic
                                                    .RadialGradient(
                                                        0.1,
                                                        0.6, 1,
                                                        [{
                                                                color: 'rgba(190, 145, 200, 0.1)',
                                                                offset: 0
                                                            },
                                                            {
                                                                color: 'rgba(190, 145, 200, 0.9)',
                                                                offset: 1
                                                            }
                                                        ])
                                            },
                                            label: {
                                                show: true,
                                                fontSize: 15,
                                                color: '#6e42e6',
                                                formatter: function (
                                                    params) {
                                                    return params
                                                        .value;
                                                }
                                            }
                                        }]
                                    }]
                                };
                                option && myChart.setOption(option);
                                // a = a + 0.01;
                            }
                        })

                    })

                    return false;
                });
                form.on('submit(data-search-btn2)', function (data) {
                    var result = data.field;
                    var la = JSON.stringify(result);
                    console.log(la);
                    $(function () {
                        $.get('/showExpert', {
                            status: 1,
                            searchParams: result
                        }, function (re) {
                            if (re == '0') {
                                layer.msg("暂无专家！");
                            } else {
                                console.log(re);
                                var obj = re.data;
                                var len = re.count;
                            }
                            html = '';
                            for (var i = 0; i < len; i++) {
                                html = html +
                                    '<div id="main2' + i +
                                    '" style="width: 600px;height:500px;display:  inline-block;margin-left: 10px;margin-top: 10px;"></div>'
                            }
                            console.log(html)
                            $('#many2').html(html);
                            console.log("len" + len)
                            for (var i = 0; i < len; i++) {
                                var myChart = echarts.init(document.getElementById(
                                    'main2' +
                                    i));
                                var option;
                                //var name = obj[i].p_expert_name;
                                var name = obj[i].s_expert_name;
                                var option;
                                option = {
                                    color: ['#6e42e6'],
                                    title: {
                                        text: name + '学术水平雷达图',
                                        left: 'center'
                                    },
                                    legend: {
                                        data: ['学术水平']
                                    },
                                    radar: {
                                        // shape: 'circle',
                                        indicator: [{
                                                name: '校内职务',
                                                max: 100
                                            },
                                            {
                                                name: '防疫志愿者时长',
                                                max: 100
                                            },
                                            {
                                                name: '上网课时长',
                                                max: 100
                                            }
                                        ],
                                        axisName: {
                                            color: '#fff',
                                            backgroundColor: '#666',
                                            borderRadius: 3,
                                            padding: [4, 5]
                                        }
                                    },
                                    series: [{
                                        name: 'Budget vs spending',
                                        type: 'radar',
                                        data: [{
                                            value: [
                                                ((obj[i].s_title *
                                                        100) /
                                                    0.4)
                                                .toFixed(
                                                    2),
                                                ((obj[i].v_time *
                                                        100) /
                                                    0.5)
                                                .toFixed(
                                                    2),
                                                ((obj[i].c_time *
                                                        100) /
                                                    0.1)
                                                .toFixed(
                                                    2)
                                            ],
                                            name: '学术水平',
                                            symbol: 'circle',

                                            symbolSize: 9,
                                            lineStyle: {
                                                color: 'rgba(170, 145, 200, 0.9)',
                                                type: 'dashed'
                                            },

                                            areaStyle: {
                                                color: new echarts
                                                    .graphic
                                                    .RadialGradient(
                                                        0.1, 0.6, 1,
                                                        [{
                                                                color: 'rgba(190, 145, 200, 0.1)',
                                                                offset: 0
                                                            },
                                                            {
                                                                color: 'rgba(190, 145, 200, 0.9)',
                                                                offset: 1
                                                            }
                                                        ])
                                            },
                                            label: {
                                                show: true,
                                                fontSize: 15,
                                                color: '#6e42e6',
                                                formatter: function (
                                                    params) {
                                                    return params
                                                        .value;
                                                }
                                            }
                                        }]
                                    }]
                                };

                                option && myChart.setOption(option);


                            }
                        })
                    })
                    return false;
                });
                form.on('submit(data-reset-btn)', function (data) {
                    window.location.reload();

                    return false;
                });
                form.on('submit(data-reset-btn2)', function (data) {
                    $(function () {
                        $.get('/showExpert', {
                            status: 1,
                            searchParams: 1
                        }, function (re) {
                            if (re == '0') {
                                layer.msg("暂无专家！");
                            } else {
                                console.log(re);
                                var obj = re.data;
                                var len = re.count;
                            }
                            html = '';
                            for (var i = 0; i < len; i++) {
                                html = html +
                                    '<div id="main2' + i +
                                    '" style="width: 600px;height:500px;display:  inline-block;margin-left: 10px;margin-top: 10px;"></div>'
                            }
                            console.log(html)
                            $('#many2').html(html);
                            console.log("len" + len)
                            for (var i = 0; i < len; i++) {
                                var myChart = echarts.init(document.getElementById(
                                    'main2' +
                                    i));
                                var option;
                                //var name = obj[i].p_expert_name;
                                var name = obj[i].s_expert_name;
                                var option;
                                option = {
                                    color: ['#6e42e6'],
                                    title: {
                                        text: name + '学术水平雷达图',
                                        left: 'center'
                                    },
                                    // legend: {
                                    //     data: ['学术水平']
                                    // },
                                    radar: {
                                        // shape: 'circle',
                                        indicator: [{
                                                name: '校内职务',
                                                max: 100
                                            },
                                            {
                                                name: '防疫志愿者时长',
                                                max: 100
                                            },
                                            {
                                                name: '上网课时长',
                                                max: 100
                                            }
                                        ],
                                        axisName: {
                                            color: '#fff',
                                            backgroundColor: '#666',
                                            borderRadius: 3,
                                            padding: [4, 5]
                                        }
                                    },
                                    series: [{
                                        name: 'Budget vs spending',
                                        type: 'radar',
                                        data: [{
                                            value: [
                                                ((obj[i].s_title *
                                                        100) /
                                                    0.4)
                                                .toFixed(
                                                    2),
                                                ((obj[i].v_time *
                                                        100) /
                                                    0.5)
                                                .toFixed(
                                                    2),
                                                ((obj[i].c_time *
                                                        100) /
                                                    0.1)
                                                .toFixed(
                                                    2)
                                            ],
                                            name: '学术水平',
                                            symbol: 'circle',

                                            symbolSize: 9,
                                            lineStyle: {
                                                color: 'rgba(170, 145, 200, 0.9)',
                                                type: 'dashed'
                                            },

                                            areaStyle: {
                                                color: new echarts
                                                    .graphic
                                                    .RadialGradient(
                                                        0.1, 0.6, 1,
                                                        [{
                                                                color: 'rgba(190, 145, 200, 0.1)',
                                                                offset: 0
                                                            },
                                                            {
                                                                color: 'rgba(190, 145, 200, 0.9)',
                                                                offset: 1
                                                            }
                                                        ])
                                            },
                                            label: {
                                                show: true,
                                                fontSize: 15,
                                                color: '#6e42e6',
                                                formatter: function (
                                                    params) {
                                                    return params
                                                        .value;
                                                }
                                            }
                                        }]
                                    }]
                                };
                                option && myChart.setOption(option);
                            }
                        })
                    })

                    return false;
                });
            })
        </script>
</body>

</html>